package com.com.knowledgepaymentmanagementsystem.service.marketing.impl;

import com.com.knowledgepaymentmanagementsystem.mapper.marketing.ShippingMapper;
import com.com.knowledgepaymentmanagementsystem.pojo.marketing.Shipping;
import com.com.knowledgepaymentmanagementsystem.service.marketing.ShippingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author DELL
 * @version 1.0
 * @description: TODO
 * @date 2025/9/23 11:35
 */
@Service
public class ShippingServiceImpl implements ShippingService {
    @Autowired
    private ShippingMapper shippingMapper;

    @Override
    public List<Shipping> getShipping(Shipping shipping) {
        return shippingMapper.getShipping(shipping);
    }

    @Override
    public Object insertShipping(Shipping shipping) {
        shipping.setStartTime(LocalDateTime.now());
        shipping.setEndTime(LocalDateTime.now());
        return shippingMapper.insert(shipping);
    }

    @Override
    public void deleteShipping(Integer shippingId) {
        shippingMapper.deleteById(shippingId);
    }

    @Override
    public void updateShipping(Shipping shipping) {
        shippingMapper.updateById(shipping);
    }

}
